<template>
    <div style="display:none">
        <button v-print="print">打印</button>
        <div id="printArea">
            <div class="printPage">
                <img :src="mouldInfo.qr" alt="" style="width:120px">
                <span>{{mouldInfo.name}}</span>
            </div>
        </div>
    </div>
</template>

<script>
    import print from '@/utils/print.js'
    export default {
        data() {
            return {
                print,
            }
        },
        props: {
            mouldInfo: {
                type: Object,
                default: () => ({})
            }
        }
    }
</script>

<style lang="less" scoped>
    #printArea {
        height: 100%;
        padding-left: 10px;
    }

    @media print {
        .printPage {
            display: flex;
            flex-direction: column;
            align-items: center;
            height: 100%;
            span{
                font-size: 12px !important;
                color: #000;
                transform: scale(0.8);
                display: inline-block;
                width: 90px;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                text-align: center;
            }
        }
    }
</style>